package com.rainy.upload.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:/upload.properties")
public class UploadConfig {

    private static Environment env;

    @Autowired
    public void setEnv(Environment env) {
        this.env = env;
    }

    public static String getTarget() {
        return env.getProperty("upload.config.target-path");
    }

    public static String getSuffix() {
        return env.getProperty("upload.config.suffix").toLowerCase();
    }

}
